package com.asion.vmovie.ui.MVPPresenter;

import com.asion.vmovie.beans.DetialsBean;
import com.asion.vmovie.beans.LunBoBean;
import com.asion.vmovie.ui.MVPContract.NewsContract;

/**
 * Created by asion on 16-10-18.
 */

public class NewsPresenter extends NewsContract.Presenter {
    @Override
    public void getNewsData(int p,int size) {
        mModel.getNewsData(p, size, new NewsContract.OnGetNewsSuccess() {
            @Override
            public void onGetSuccess(DetialsBean detialsBean) {
                mView.showDataSuccess(detialsBean);
            }

            @Override
            public void onGetError(Throwable throwable) {
                mView.showDataError(throwable);
            }
        });
    }

    @Override
    public void getBanner() {
        mModel.getBanner(new NewsContract.OnGetBanner() {
            @Override
            public void onSuccess(LunBoBean lunBoBean) {
                mView.showDataSuccess(lunBoBean);
            }

            @Override
            public void onError(Throwable throwable) {
                mView.showDataError(throwable);
            }
        });
    }
}
